<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name, age) {
                this.name = name;
                this.age = age;
                this.sayHi = function () {
                    console.log('Ni好');
                }
            }
            var yq = new Person('于谦', 40);
            function Person(name, age) {
                this.name = name;
                this.age = age;
                this.sayHi = function () {
                    console.log('Ni好');
                }
            }
            var yq = new Person('于谦', 40);
            function Person(name, age) {
                this.name = name;
                this.age = age;
                this.sayHi = function () {
                    console.log('Ni好');
                }
            }
            var yq = new Person('于谦', 40);
    </script>
    <!-- 1.开辟内存空间 -->
    <!-- 2.把对象指向this -->
    <!-- 3.给属性设置值 -->
    <!-- 4.返回this这个对象并把地址给对象 -->
      <!-- 1.开辟内存空间 -->
    <!-- 2.把对象指向this -->
    <!-- 3.给属性设置值 -->
    <!-- 4.返回this这个对象并把地址给对象 -->
      <!-- 1.开辟内存空间 -->
    <!-- 2.把对象指向this -->
    <!-- 3.给属性设置值 -->
    <!-- 4.返回this这个对象并把地址给对象 -->
</body>
</html>